import {
  shopList
} from '../static/shop'

export const shops = {
  getShopList() {
    return shopList
  },
  getShopNames() {
    return shopList.reduce((result, cur) => {
      result[cur.id] = cur.name
      return result
    }, {})
  },
  getShopObj() {
    const list = {}
    for (const s of shopList) {
      list[s.id] = s
    }
    return list
  },
  getShop(id) {
    let shop = null
    shopList.forEach(ele => {
      if (ele.id == id) shop = ele
    });
    return shop
  },
}

export {
  shopList
}